package com.hippo.core.ui.compose.login.forget

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.hippo.core.R
import com.hippo.core.core.ext.paddingBody
import com.hippo.core.ui.components.CommonBody
import com.hippo.core.ui.components.ThemeButton
import com.hippo.core.ui.components.VerticalSpacer
import com.hippo.core.ui.theme.HippoTheme

@Composable
fun ResetSuccessScreen(onBack:()->Unit,toLogin:()->Unit) {


    CommonBody(
        title = stringResource(R.string.verify_9),
        onBack = onBack
    ) {

        Column(
            horizontalAlignment = Alignment.CenterHorizontally,
            modifier = Modifier
                .fillMaxSize()
                .paddingBody()
        ) {

            VerticalSpacer(10.dp,modifier = Modifier.weight(1F))

            Image(
                painter = painterResource(id = R.mipmap.success),
                contentDescription = null,
                modifier = Modifier.size(70.dp)
            )

            VerticalSpacer(30.dp)

            Text(
                text = stringResource(R.string.verify_2),
                style = MaterialTheme.typography.labelLarge
            )

             VerticalSpacer(50.dp)

            ThemeButton(
                modifier = Modifier.fillMaxWidth(),
                text = stringResource(R.string.verify_14),
                onClick = {
                    toLogin()
                }
            )

            VerticalSpacer(10.dp,modifier = Modifier.weight(4F))

        }
    }

}


@Preview(showBackground = true)
@Composable
private fun ResetSuccessScreenPreview() {

    HippoTheme {
        ResetSuccessScreen({},{})
    }

}